<{include file='public/head'}>
<div class="layui-body">
	<div class="layui-tab layui-tab-brief">
		  <ul class="layui-tab-title">
			<li class="layui-this"><{$MenuName}>列表</li>
			<li><a href="<{:url('add')}>"><{$MenuName}>添加</a></li>
		  </ul>
			<div class="layui-tab-content">
				<form action="<{:url('index')}>" method="get" class="layui-form">
					<div class="layui-form-item nospace">
					<label class="layui-form-label">关键字</label>
						 <div class="layui-input-inline">
							<input type="text" name="keyword" placeholder="请输入关键字" value="<{$UrlParam.keyword|default=''}>"  class="layui-input">
						 </div>
						 <div class="layui-input-inline">
							<button class="layui-btn" lay-submit>搜索</button>
						 </div>
					</div>
				</form>
				<form class="layui-form" method="post" id="contentForm" name="contentForm">
					<div class="page-module-table">
						<table class="layui-table">
							<thead>
							<tr>
								<th>
									<input type="checkbox" class="checkbox" lay-ignore id="checkall" title="全选">
								</th>
								<th>排序</th>
								<th><{$MenuName}>名称</th>
								<th>链接地址</th>
								<th>是否禁用</th>
								<th>添加时间</th>
								<th>操作</th>
							</tr>
							</thead>
							<tbody>
							<{volist name="List" id="val"}>
							<tr>
								<td>
								<input type="checkbox" class="checkbox checkitem" lay-ignore name="Del[]" value="<{$val.NewsID}>">
		                    	<input type="hidden" name="listall[]" value="<{$val.NewsID}>">								
								</td>
								<td class="table-input"><input type="text" name="Sort[<{$val.NewsID}>]" lay-ignore class="layui-input" value="<{$val.NewsSort}>"></td>
								<td>
									<{$val.NewsTitle}>
								</td>
								<td>
									<{$val.NewsContent}>
								</td>
								<td>
									<{if condition="$val['NewsState'] eq 1"}>
									<a href="<{:url('/Siteweb/Editstate/NewsID/'.$val.NewsID.'/NewsState/0')}>"><i class='fa fa-toggle-on' title="点击关闭显示"></i></a>
									<{else}>
									<a href="<{:url('/Siteweb/Editstate/NewsID/'.$val.NewsID.'/NewsState/1')}>"><i class='fa fa-toggle-off' title="点击开启显示"></i></a>
									<{/if}>
								</td>               
								<td>
									<{$val.NewsTime}>
								</td>
								<td>
									<div class="layui-btn-group">
										<a class="layui-btn layui-btn-xs" href="<{:url('edit',array('id'=>$val['NewsID']))}>"><i class="layui-icon"></i>编辑</a>
										 <a class="layui-btn layui-btn-xs layui-btn-danger" href="<{:url('del',array('id'=>$val['NewsID']))}>"><i class="layui-icon"></i>删除</a>
									</div>
								</td>
							</tr>
							<{/volist}>
							</tbody>
						</table>
						<button type="submit" name="submit" onclick="return setDelAction();" class="layui-btn layui-btn-danger">批量删除</button>
						<button type="submit" name="submit" onclick="return setSortAction();" value="sorting" class="layui-btn">保存排序</button>
						 <script>
							function setDelAction(){
								document.contentForm.action = "<{:url('del')}>"; 
								return confirm("您确定要删除选中的内容么？");
							}
							function setSortAction(){
								document.contentForm.action = "<{:url('sort')}>"; 
								return confirm("您确定要进行排序？");
							}
						</script>
						<div class="page"><{$List->render()}></div>
					</div>
				</form>
			</div>
	</div>
</div>
<{include file="public/foot"}>